package com.diandian.backend.kuaishou.life.task.task;

import com.diandian.backend.kuaishou.life.task.service.BusinessRefreshTokenCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
public class KuaiShouRefreshTokenCheckTask {

    @Autowired
    private BusinessRefreshTokenCheckService refreshTokenCheckService;

    /**
     * 校验所有的refresh token是否有效
     * 说明：以数据库中refresh token的有效时间为准
     * 时间设置：每天1点
     */
    @Scheduled(cron = "0 0 8 * * ?") // 生产使用
//    @Scheduled(cron = "0 */1 * * * ?") // 测试使用
    public void pullOnlineOrder() {
        refreshTokenCheckService.refreshTokenCheck();
    }


}
